import React from 'react'
import {withRouter} from 'react-router-dom'
import {NavBar} from 'antd-mobile'
import './navBar.scss'
class NavHeader extends React.Component{
    defaultLeft=()=>{
        this.props.history.go(-1)
    }
    render(){
        let {leftClick,children,rightClick,styleName}=this.props
        return  <NavBar
                    style={styleName}
                    className='nav-head'
                    mode="light"
                    icon={<i className="iconfont icon-back" />}
                    onLeftClick={leftClick||this.defaultLeft}
                    rightContent={rightClick}
                >{children}</NavBar>
    }
}


export default withRouter(NavHeader)